package com.meida.module.bus.provider.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.GetInterceptor;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.bus.client.entity.BusOrder;
import com.meida.module.bus.client.entity.BusOrderAnswer;
import com.meida.module.user.client.entity.AppUser;
import org.springframework.stereotype.Component;

/**
 * 订单答案详情
 *
 * @author zyf
 */
@Component
public class BusOrderAnswerGetHandler implements GetInterceptor {


    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.clear();
        cq.select(BusOrderAnswer.class, "*");
        cq.select(BusOrder.class, "orderNo");
        cq.select(AppUser.class, "userName", "nickName");
        cq.eq(BusOrderAnswer.class, "answerId");
        cq.createJoin(BusOrder.class).setMainField("orderId").setJoinField("orderId");
        cq.createJoin(AppUser.class).setMainField("answerUserId").setJoinField("userId");

    }

    @Override
    public void complete(CriteriaQuery cq, EntityMap map) {

    }
}
